package com.example.mapp.buildSql;

import java.util.Map;

public class DataInterfaceMappSql {

    /**
     * 获取维保记录
     *
     * @return
     */
    public String listMaintenanceRecordsInterface(Map map) {

        StringBuffer sb = new StringBuffer();
        sb.append(" SELECT tb1.elevatorNum as 'elevatorNum', ");
        sb.append(" py.credit_code as 'id', ");
        sb.append(" py.party_name as 'maintenancePartyName', ");
        sb.append(" tb1.startDate as 'startDate', ");
        sb.append(" tb1.endDate as 'endDate', ");
        sb.append(" su1.card_type as 'cardType1', ");
        sb.append(" su1.card_number as 'identityCard1', ");
        sb.append(" su1.user_name as 'maintenanceName1', ");
        sb.append(" su2.card_type as 'cardType2', ");
        sb.append(" su2.card_number as 'identityCard2', ");
        sb.append(" su2.user_name as 'maintenanceName2', ");
        sb.append(" tb1.maintenanceType as 'maintenanceType', ");
        sb.append(" tb1.halfMonId, ");
        sb.append(" tb1.quarterId, ");
        sb.append(" tb1.halfYearId ");
        sb.append(" from ( ");
        sb.append(" SELECT thm.elevator_num as 'elevatorNum', ");
        sb.append(" thm.maintenance_start_date as 'startDate', ");
        sb.append(" thm.maintenance_end_date as 'endDate', ");
        sb.append(" thm.maintenance_party_id as 'partyId', ");
        sb.append(" thm.maintenance_user_id1 as 'user1', ");
        sb.append(" thm.maintenance_user_id2 as 'user2', ");
        sb.append(" '曳引电梯' as 'maintenanceType', ");
        sb.append(" tq.half_mon_id as 'halfMonId', ");
        sb.append(" thy.quarter_id as 'quarterId', ");
        sb.append(" ty.half_year_id as 'halfYearId' ");
        sb.append(" FROM traction_half_mon thm  ");
        sb.append(" LEFT JOIN traction_quarter tq ON thm.id = tq.half_mon_id  ");
        sb.append(" LEFT JOIN traction_half_year thy ON thy.quarter_id = tq.id ");
        sb.append(" LEFT JOIN traction_year ty ON ty.half_year_id = thy.id ");
        sb.append(" UNION ALL ");
        sb.append(" SELECT ");
        sb.append(" hhm.elevator_num as 'elevatorNum', ");
        sb.append(" hhm.maintenance_start_date as 'startDate', ");
        sb.append(" hhm.maintenance_end_date as 'endDate', ");
        sb.append(" hhm.maintenance_party_id as 'partyId', ");
        sb.append(" hhm.maintenance_user_id1 as 'user1', ");
        sb.append(" hhm.maintenance_user_id2 as 'user2',");
        sb.append(" '液压电梯' as 'maintenanceType', ");
        sb.append(" tq.half_mon_id as 'halfMonId',  ");
        sb.append(" thy.quarter_id as 'quarterId', ");
        sb.append(" ty.half_year_id as 'halfYearId' ");
        sb.append(" FROM ");
        sb.append(" hydpress_half_mon hhm ");
        sb.append(" LEFT JOIN hydpress_quarter tq ON tq.half_mon_id = hhm.id ");
        sb.append(" LEFT JOIN hydpress_half_year thy ON thy.quarter_id = tq.id ");
        sb.append(" LEFT JOIN hydpress_year ty ON ty.half_year_id = thy.id ");
        sb.append(" UNION ALL ");
        sb.append(" SELECT ");
        sb.append(" ehm.elevator_num as 'elevatorNum', ");
        sb.append(" ehm.maintenance_start_date as 'startDate', ");
        sb.append(" ehm.maintenance_end_date as 'endDate', ");
        sb.append(" ehm.maintenance_party_id as 'partyId', ");
        sb.append(" ehm.maintenance_user_id1 as 'user1', ");
        sb.append(" ehm.maintenance_user_id2 as 'user2', ");
        sb.append(" '自动扶梯' as 'maintenanceType', ");
        sb.append(" tq.half_mon_id as 'halfMonId', ");
        sb.append(" thy.quarter_id as 'quarterId', ");
        sb.append(" ty.half_year_id as 'halfYearId' ");
        sb.append(" FROM escalator_half_mon ehm ");
        sb.append(" LEFT JOIN escalator_quarter tq ON tq.half_mon_id = ehm.id ");
        sb.append(" LEFT JOIN escalator_half_year thy ON thy.quarter_id = tq.id ");
        sb.append(" LEFT JOIN escalator_year ty ON ty.half_year_id = thy.id ");
        sb.append(" UNION ALL ");
        sb.append(" SELECT ");
        sb.append(" dhm.elevator_num as 'elevatorNum', ");
        sb.append(" dhm.maintenance_start_date as 'startDate', ");
        sb.append(" dhm.maintenance_end_date as 'endDate', ");
        sb.append(" dhm.maintenance_party_id as 'partyId', ");
        sb.append(" dhm.maintenance_user_id1 as 'user1', ");
        sb.append(" dhm.maintenance_user_id2 as 'user2', ");
        sb.append(" '杂物电梯' as 'maintenanceType', ");
        sb.append(" tq.half_mon_id as 'halfMonId', ");
        sb.append(" thy.quarter_id as 'quarterId', ");
        sb.append(" ty.half_year_id as 'halfYearId' ");
        sb.append(" FROM debris_half_mon dhm ");
        sb.append(" LEFT JOIN debris_quarter tq ON tq.half_mon_id = dhm.id ");
        sb.append(" LEFT JOIN debris_half_year thy ON thy.quarter_id = tq.id ");
        sb.append(" LEFT JOIN debris_year ty ON ty.half_year_id = thy.id ");
        sb.append(" ) tb1 ");
        sb.append(" LEFT JOIN party py ON tb1.partyId = py.id ");
        sb.append(" LEFT JOIN sys_user su1 ON tb1.user1 = su1.id ");
        sb.append(" LEFT JOIN sys_user su2 ON tb1.user2 = su2.id ");
        sb.append(" where tb1.startDate >= " + map.get("startTime").toString() + "  and tb1.endDate<=" + map.get("endTime").toString() + " ");

        return sb.toString();
    }

    /**
     * 获取维保项目---曳引
     */
    public String listMaintenanceProjectInterface(Map map) {

        StringBuffer sb = new StringBuffer();
        sb.append(" SELECT thm.elevator_num as 'elevatorNum', ");
        sb.append(" thm.maintenance_start_date as 'startDate', ");
        sb.append(" thm.maintenance_end_date as 'endDate', ");
        sb.append(" thm.accuracy_car_deck as 'accuracyCarDeck', ");
        sb.append(" thm.anti_collision_protector as 'antiCollisionProtector', ");
        sb.append(" thm.automatic_closing_device as 'automaticClosingDevice', ");
        sb.append(" thm.automatic_reset as 'automaticReset', ");
        sb.append(" thm.brake_clearance as 'brakeClearance', ");
        sb.append(" thm.brake_each_position as 'brakeEachPosition', ");
        sb.append(" thm.break_external_protection as 'breakExternalProtection', ");
        sb.append(" thm.bypass_device as 'bypassDevice', ");
        sb.append(" thm.car_alarm_device as 'carAlarmDevice', ");
        sb.append(" thm.car_door_run as 'carDoorRun', ");
        sb.append(" thm.car_lighting as 'carLighting', ");
        sb.append(" thm.car_overhaul_switch as 'carOverhaulSwitch', ");
        sb.append(" thm.car_top as 'carTop', ");
        sb.append(" thm.car_top_switch as 'carTopSwitch', ");
        sb.append(" thm.counterweight_block as 'counterweightBlock', ");
        sb.append(" thm.display_command_button as 'displayCommandButton', ");
        sb.append(" thm.drive_host as 'driveHost', ");
        sb.append(" thm.electric_contact as 'electricContact', ");
        sb.append(" thm.electrical_contact as 'electricalContact', ");
        sb.append(" thm.emergency_electric_operation as 'emergencyElectricOperation', ");
        sb.append(" thm.emergency_operation_device as 'emergencyOperationDevice', ");
        sb.append(" thm.encoder as 'encoder', ");
        sb.append(" thm.guide_shoe_cup as 'guideShoeCup', ");
        sb.append(" thm.landing_sill as 'landingSill', ");
        sb.append(" thm.layer_locking_length as 'layerLockingLength', ");
        sb.append(" thm.limiter_each_part as 'limiterEachPart', ");
        sb.append(" thm.pit_eenvironment as 'pitEenvironment', ");
        sb.append(" thm.pit_stop as 'pitStop', ");
        sb.append(" thm.room_environment as 'roomEnvironment', ");
        sb.append(" thm.station_call as 'stationCall', ");
        sb.append(" thm.well_illumination as 'wellIllumination', ");
        sb.append(" tq.brake_lining as 'brakeLining', ");
        sb.append(" tq.car_shoe_roller as 'carShoeRoller', ");
        sb.append(" tq.door_guide_shoe as 'doorGuideShoe', ");
        sb.append(" tq.electrical_safety_device as 'electricalSafetyDevice', ");
        sb.append(" tq.encoder as 'encoder', ");
        sb.append(" tq.energy_dissipation_buffer as 'energyDissipationBuffer',  ");
        sb.append(" tq.fire_switch as 'fireSwitch', ");
        sb.append(" tq.layer_dynamic_contact as 'layerDynamicContact', ");
        sb.append(" tq.limiter_wheel_safety as 'limiterWheelSafety', ");
        sb.append(" tq.limiter_wheel_wire as 'limiterWheelWire', ");
        sb.append(" tq.lubricating_oil as 'lubricatingOil', ");
        sb.append(" tq.traction_wheel_groove as 'tractionWheelGroove', ");
        sb.append(" tq.transmission_steel as 'transmissionSteel', ");
        sb.append(" thy.all_instrument as 'allInstrument', ");
        sb.append(" thy.bearing_department as 'bearingDepartment', ");
        sb.append(" thy.brake_action_monitoring as 'brakeActionMonitoring', ");
        sb.append(" thy.buffer_distance as 'bufferDistance', ");
        sb.append(" thy.compensating_rope as 'compensatingRope', ");
        sb.append(" thy.compensation_link as 'compensationLink', ");
        sb.append(" thy.control_cabinet_terminals as 'controlCabinetTerminals', ");
        sb.append(" thy.door_open_limit_device as 'doorOpenLimitDevice', ");
        sb.append(" thy.driving_wheel as 'drivingWheel', ");
        sb.append(" thy.limit_switch as 'limitSwitch', ");
        sb.append(" thy.limiter_wheel_wire as 'limiterWheelWire', ");
        sb.append(" thy.limiter_wire_rope as 'limiterWireRope',");
        sb.append(" thy.motor_reducer_coupling as 'motorReducerCoupling', ");
        sb.append(" thy.rope_combination as 'ropeCombination', ");
        sb.append(" thy.traction_wheel_groove as 'tractionWheelGroove', ");
        sb.append(" ty.bottom_mounting_bolt as 'bottomMountingBolt', ");
        sb.append(" ty.brake_capacity as 'brakeCapacity', ");
        sb.append(" ty.brake_plunger as 'brakePlunger', ");
        sb.append(" ty.buffer as 'buffer', ");
        sb.append(" ty.car_emergency_test as 'carEmergencyTest', ");
        sb.append(" ty.car_guide_bracket as 'carGuideBracket', ");
        sb.append(" ty.car_guide_rail as 'carGuideRail',  ");
        sb.append(" ty.car_weighing_device as 'carWeighingDevice', ");
        sb.append(" ty.contactor_contact as 'contactorContact', ");
        sb.append(" ty.device_and_sill as 'deviceAndSill', ");
        sb.append(" ty.insulation_performance_test as 'insulationPerformanceTest', ");
        sb.append(" ty.limiter_safety_clamp_linkage_test as 'limiterSafetyClampLinkageTest', ");
        sb.append(" ty.safety_clamp_holder as 'safetyClampHolder', ");
        sb.append(" ty.top_mounting_bolt as 'topMountingBolt', ");
        sb.append(" ty.traveling_cable as 'travelingCable', ");
        sb.append(" ty.uplink_overspeed_protection_test as 'uplinkOverspeedProtectionTest', ");
        sb.append(" ty.year_lubricating_oil as 'yearLubricatingOil', ");
        sb.append(" '曳引电梯' as 'maintenanceType', ");
        sb.append(" tq.half_mon_id as 'halfMonId', ");
        sb.append(" thy.quarter_id as 'quarterId', ");
        sb.append(" ty.half_year_id as 'halfYearId' ");
        sb.append(" FROM traction_half_mon thm ");
        sb.append(" LEFT JOIN traction_quarter tq ON thm.id = tq.half_mon_id ");
        sb.append(" LEFT JOIN traction_half_year thy ON thy.quarter_id = tq.id ");
        sb.append(" LEFT JOIN traction_year ty ON ty.id = thy.id ");
        sb.append(" where thm.maintenance_start_date >= " + map.get("startTime").toString() + "  and thm.maintenance_end_date<=" + map.get("endTime").toString() + " ");

        return sb.toString();
    }

    /**
     * 获取维保项目---曳引
     */
    public String listMaintenanceProjectInterfaceHydpress(Map map) {

        StringBuffer sb = new StringBuffer();
        sb.append(" SELECT hhm.elevator_num as 'elevatorNum', ");
        sb.append(" hhm.maintenance_start_date as 'startDate', ");
        sb.append(" hhm.maintenance_end_date as 'endDate', ");
        sb.append(" hhm.alarm_intercom as 'alarmIntercom', ");
        sb.append(" hhm.anti_collision_protector as 'antiCollisionProtector', ");
        sb.append(" hhm.automatic_closing_device as 'automaticClosingDevice', ");
        sb.append(" hhm.automatic_reset as 'automaticReset', ");
        sb.append(" hhm.car_deck_accuracy as 'carDeckAccuracy', ");
        sb.append(" hhm.car_door_run as 'carDoorRun', ");
        sb.append(" hhm.car_lighting as 'carLighting', ");
        sb.append(" hhm.car_overhaul_switch as 'carOverhaulSwitch', ");
        sb.append(" hhm.car_top as 'carTop', ");
        sb.append(" hhm.cardoor_lock_contact as 'cardoorLockContact', ");
        sb.append(" hhm.cartop_overhaul_device as 'cartopOverhaulDevice', ");
        sb.append(" hhm.display_command_button as 'displayCommandButton', ");
        sb.append(" hhm.electrical_contact as 'electricalContact', ");
        sb.append(" hhm.encoder as 'encoder', ");
        sb.append(" hhm.gate_bypass_device as 'gateBypassDevice', ");
        sb.append(" hhm.guide_shoe_cup as 'guideShoeCup', ");
        sb.append(" hhm.hydraulic_oil_pipe as 'hydraulicOilPipe', ");
        sb.append(" hhm.hydraulic_plunger as 'hydraulicPlunger', ");
        sb.append(" hhm.landing_sill as 'landingSill', ");
        sb.append(" hhm.layer_locking_length as 'layerLockingLength', ");
        sb.append(" hhm.limiter_each_part as 'limiterEachPart', ");
        sb.append(" hhm.motor as 'motor', ");
        sb.append(" hhm.operating_device as 'operatingDevice', ");
        sb.append(" hhm.pit as 'pit', ");
        sb.append(" hhm.pit_stop as 'pitStop', ");
        sb.append(" hhm.room_environment as 'roomEnvironment', ");
        sb.append(" hhm.sth_parts as 'sthParts', ");
        sb.append(" hhm.storey_display as 'storeyDisplay', ");
        sb.append(" hhm.tank as 'tank', ");
        sb.append(" hhm.well_illumination as 'wellIllumination', ");
        sb.append(" hq.car_shoe_roller as 'carShoeRoller', ");
        sb.append(" hq.door_guide_shoe as 'doorGuideShoe', ");
        sb.append(" hq.electrical_safety_device as 'electricalSafetyDevice', ");
        sb.append(" hq.energy_dissipation_buffer as 'energyDissipationBuffer', ");
        sb.append(" hq.fire_switch as 'fireSwitch', ");
        sb.append(" hq.hand_down_valve as 'handDownValve', ");
        sb.append(" hq.hand_pump as 'handPump',  ");
        sb.append(" hq.limiter_tensioning_wheel as 'limiterTensioningWheel', ");
        sb.append(" hq.limiter_wheel_wire as 'limiterWheelWire', ");
        sb.append(" hq.oil_temperature_monitor as 'oilTemperatureMonitor', ");
        sb.append(" hq.plunger_side_shoe as 'plungerSideShoe', ");
        sb.append(" hq.safety_relief_valve as 'safetyReliefValve', ");
        sb.append(" hq.transmission_wire_rope as 'transmissionWireRope', ");
        sb.append(" hhy.bleed_operation as 'bleedOperation', ");
        sb.append(" hhy.control_cabinet as 'controlCabinet', ");
        sb.append(" hhy.control_cabinet_terminals as 'controlCabinetTerminals', ");
        sb.append(" hhy.guide_wheel as 'guideWheel', ");
        sb.append(" hhy.limiter_wire_rope as 'limiterWireRope', ");
        sb.append(" hhy.plunger_spacing_device as 'plungerSpacingDevice', ");
        sb.append(" hhy.suspension_wire_rope as 'suspensionWireRope', ");
        sb.append(" hhy.updown_limit_switch as 'updownLimitSwitch', ");
        sb.append(" hhy.wire_head_combination as 'wireHeadCombination', ");
        sb.append(" hy.buffer as 'buffer', ");
        sb.append(" hy.car_cylinder_guide as 'carCylinderGuide', ");
        sb.append(" hy.car_subsidence_test as 'carSubsidenceTest', ");
        sb.append(" hy.car_weighing_device as 'carWeighingDevice', ");
        sb.append(" hy.guide_bracket as 'guideBracket', ");
        sb.append(" hy.insulation_performance_test as 'insulationPerformanceTest', ");
        sb.append(" hy.limiter_safetyclamp_test as 'limiterSafetyclampTest', ");
        sb.append(" hy.mounting_bolt as 'mountingBolt', ");
        sb.append(" hy.mounting_bolts as 'mountingBolts', ");
        sb.append(" hy.power_mounting_bolts as 'powerMountingBolts', ");
        sb.append(" hy.relay_contact as 'relayContact', ");
        sb.append(" hy.safety_clamp_holder as 'safetyClampHolder', ");
        sb.append(" hy.storey_gate_device as 'storeyGateDevice', ");
        sb.append(" hy.traveling_cable as 'travelingCable', ");
        sb.append(" '液压电梯' as 'maintenanceType',   ");
        sb.append(" hq.half_mon_id as 'halfMonId', ");
        sb.append(" hhy.quarter_id as 'quarterId', ");
        sb.append(" hy.half_year_id as 'halfYearId' ");
        sb.append(" FROM hydpress_half_mon hhm ");
        sb.append(" LEFT JOIN hydpress_quarter hq ON hhm.id = hq.half_mon_id  ");
        sb.append(" LEFT JOIN hydpress_half_year hhy ON hhy.quarter_id = hq.id ");
        sb.append(" LEFT JOIN hydpress_year hy ON hy.id = hhy.id  ");
        sb.append(" where hhm.maintenance_start_date >= " + map.get("startTime").toString() + "  and hhm.maintenance_end_date<=" + map.get("endTime").toString() + " ");

        return sb.toString();
    }

    /**
     * 获取维保项目---自动
     */
    public String listMaintenanceProjectInterfaceEsCalator(Map map) {

        StringBuffer sb = new StringBuffer();
        sb.append("	select ehm.elevator_num as 'elevatorNum',ehm.maintenance_end_date as 'endDate',ehm.maintenance_start_date as 'startDate', ehm.separateroom_drive_steeringstation  as 'separateroomDriveSteeringstation', ");
        sb.append("	ehm.auto_run_function  as 'autoRunFunction', ");
        sb.append("	ehm.automatic_oil_level  as 'automaticOilLevel', ");
        sb.append("	ehm.brake_condition_monitoring_switch  as 'brakeConditionMonitoringSwitch', ");
        sb.append("	ehm.comb_plate_illumination  as 'combPlateIllumination', ");
        sb.append("	ehm.comb_plate_switch  as 'combPlateSwitch', ");
        sb.append("	ehm.comb_tread_tooth  as 'combTreadTooth', ");
        sb.append("	ehm.electrical_components  as 'electricalComponents', ");
        sb.append("	ehm.emergency_stop_switch  as 'emergencyStopSwitch', ");
        sb.append("	ehm.equipment_operation_status  as 'equipmentOperationStatus', ");
        sb.append("	ehm.exit_safety_warn  as 'exitSafetyWarn', ");
        sb.append("	ehm.fault_display_board  as 'faultDisplayBoard', ");
        sb.append("	ehm.fixing_of_main  as 'fixingOfMain', ");
        sb.append("	ehm.handrail  as 'handrail', ");
        sb.append("	ehm.handrail_baseboard  as 'handrailBaseboard', ");
        sb.append("	ehm.handrail_run  as 'handrailRun', ");
        sb.append("	ehm.hmon_brake_mechanism  as 'hmonBrakeMechanism', ");
        sb.append("	ehm.hmon_reducer_lubricating_oil  as 'hmonReducerLubricatingOil', ");
        sb.append("	ehm.hmonmain_drive_chain  as 'hmonmainDriveChain', ");
        sb.append("	ehm.inspection_control_device  as 'inspectionControlDevice', ");
        sb.append("	ehm.motor_vent as 'motorVent', ");
        sb.append("	ehm.overspeed_monitoring_device  as 'overspeedMonitoringDevice', ");
        sb.append("	ehm.pedal_apron_clearance  as 'pedalApronClearance', ");
        sb.append("	ehm.pedal_missing_monitoring  as 'pedalMissingMonitoring', ");
        sb.append("	ehm.pedal_sink_switch  as 'pedalSinkSwitch', ");
        sb.append("	ehm.protective_baffle  as 'protectiveBaffle', ");
        sb.append("	ehm.protective_switch  as 'protectiveSwitch', ");
        sb.append("	ehm.repair_cover_plate  as 'repairCoverPlate', ");
        sb.append("	ehm.running_direction_display  as 'runningDirectionDisplay', ");
        sb.append("	ehm.step_roller_guiderail  as 'stepRollerGuiderail', ");
        sb.append("	ehm.stepchain_tension_switch  as 'stepchainTensionSwitch', ");
        sb.append("	ehm.updown_illumination  as 'updownIllumination', ");
        sb.append("	ehm.updown_protect_railing  as 'updownProtectRailing', ");
        sb.append("	eq.antiflood_protection_device	as 'antifloodProtectionDevice', ");
        sb.append("	eq.cascade_lubrication	as 'cascadeLubrication', ");
        sb.append("	eq.speed_of_handrail	as 'speedOfHandrail', ");
        sb.append("	eq.step_bushings	as 'stepBushings', ");
        sb.append("	eq.stepchain_tensioning_device	as 'stepchainTensioningDevice', ");
        sb.append("	ehy.adjust_depth_clearance	as	'adjustDepthClearance', ");
        sb.append("	ehy.armrest_spring_length	as	'armrestSpringLength', ");
        sb.append("	ehy.auxiliary_brake	as	'auxiliaryBrake', ");
        sb.append("	ehy.brake_lining_thickness	as	'brakeLiningThickness', ");
        sb.append("	ehy.handrail_speed_monitoring	as	'handrailSpeedMonitoring', ");
        sb.append("	ehy.hyear_brake_mechanism	as	'hyearBrakeMechanism', ");
        sb.append("	ehy.hyear_main_drive_chain	as	'hyearMainDriveChain', ");
        sb.append("	ehy.hyear_reducer_lubricating_oil	as	'hyearReducerLubricatingOil', ");
        sb.append("	ehy.maindrive_slider	as	'maindriveSlider', ");
        sb.append("	ehy.motor_reducer_coupling	as	'motorReducerCoupling', ");
        sb.append("	ehy.noload_run_distance	as	'noloadRunDistance', ");
        sb.append("	ehy.steppedal_heating_device	as	'steppedalHeatingDevice', ");
        sb.append("	ey.handrail_guideblock_guidewheel	as	'handrailGuideblockGuidewheel', ");
        sb.append("	ey.apronplate_butt_joint	as	'apronplateButtJoint', ");
        sb.append("	ey.apronplate_safety_switch	as	'apronplateSafetySwitch', ");
        sb.append("	ey.armrest_inner_flange	as	'armrestInnerFlange', ");
        sb.append("	ey.cable	as	'cable', ");
        sb.append("	ey.electrical_safety_device	as	'electricalSafetyDevice', ");
        sb.append("	ey.handrail_breaking_protective	as	'handrailBreakingProtective', ");
        sb.append("	ey.handrail_wheel	as	'handrailWheel', ");
        sb.append("	ey.host_speed_detection	as	'hostSpeedDetection', ");
        sb.append("	ey.inner_momentum	as	'innerMomentum', ");
        sb.append("	ey.inout_plate_connection	as	'inoutPlateConnection', ");
        sb.append("	ey.main_contactor	as	'mainContactor', ");
        sb.append(" '自动扶梯' as 'maintenanceType',   ");
        sb.append(" eq.half_mon_id as 'halfMonId', ");
        sb.append(" ehy.quarter_id as 'quarterId', ");
        sb.append(" ey.half_year_id as 'halfYearId' ");
        sb.append(" FROM escalator_half_mon ehm ");
        sb.append(" LEFT JOIN escalator_quarter eq ON ehm.id = eq.half_mon_id  ");
        sb.append(" LEFT JOIN escalator_half_year ehy ON ehy.quarter_id = eq.id ");
        sb.append(" LEFT JOIN escalator_year ey ON ey.id = ehy.id  ");
        sb.append(" where ehm.maintenance_start_date >= " + map.get("startTime").toString() + "  and ehm.maintenance_end_date<=" + map.get("endTime").toString() + " ");

        return sb.toString();
    }

    /**
     * 杂物
     * @param map
     * @return
     */
    public String listMaintenanceProjectInterfaceDebris(Map map) {

        StringBuffer sb = new StringBuffer();
        sb.append(" select 	dhm.elevator_num as 'elevatorNum',		");
        sb.append("	dhm.maintenance_start_date as 'startDate',		");
        sb.append("	dhm.maintenance_end_date as 'endDate',		");
        sb.append("	dhm.brake_clearance	as 'brakeClearance',	");
        sb.append("	dhm.brake_position	as 'brakePosition',	");
        sb.append("	dhm.car_top	as 'carTop',	");
        sb.append("	dhm.counter_weight	as 'counterWeight',	");
        sb.append("	dhm.cproom_environment	as 'cproomEnvironment',	");
        sb.append("	dhm.door_auto_reset	as 'doorAutoReset',	");
        sb.append("	dhm.door_guide	as 'doorGuide',	");
        sb.append("	dhm.door_lock_contact	as 'doorLockContact',	");
        sb.append("	dhm.drive_host	as 'driveHost',	");
        sb.append("	dhm.electrical_contact	as 'electricalContact',	");
        sb.append("	dhm.floor_display	as 'floorDisplay',	");
        sb.append("	dhm.landing_sill	as 'landingSill',	");
        sb.append("	dhm.limiter_part	as 'limiterPart',	");
        sb.append("	dhm.locking_length	as 'lockingLength',	");
        sb.append("	dhm.manual_emergency_operation	as 'manualEmergencyOperation',	");
        sb.append("	dhm.oil_cup	as 'oilCup',	");
        sb.append("	dhm.pit_environment	as 'pitEnvironment',	");
        sb.append("	dhm.pit_stop	as 'pitStop',	");
        sb.append("	dhm.stop_device	as 'stopDevice',	");
        sb.append("	dhm.well_light	as 'wellLight',	");
        sb.append("	dq.brake_lining	as 'brakeLining',	");
        sb.append("	dq.door_guide_shoe	as 'doorGuideShoe',	");
        sb.append("	dq.limiter_wheel_groove	as 'limiterWheelGroove',	");
        sb.append("	dq.limiter_wheel_safety	as 'limiterWheelSafety',	");
        sb.append("	dq.lubricating_oil	as 'lubricatingOil',	");
        sb.append("	dq.shoe_linin	as 'shoeLinin',	");
        sb.append("	dq.traction_wheel_groove	as 'tractionWheelGroove',	");
        sb.append("	dq.transmission_steel	as 'transmissionSteel',	");
        sb.append("	dhy.all_instrument	as 'allInstrument',	");
        sb.append("	dhy.buffer_distance	as 'bufferDistance',	");
        sb.append("	dhy.driving_wheel	as 'drivingWheel',	");
        sb.append("	dhy.limit_switch	as 'limitSwitch',	");
        sb.append("	dhy.limiter_wire_rope	as 'limiterWireRope',	");
        sb.append("	dhy.line_terminals	as 'lineTerminals',	");
        sb.append("	dhy.motor_coupling	as 'motorCoupling',	");
        sb.append("	dhy.rope_combination	as 'ropeCombination',	");
        sb.append("	dhy.suspension_device	as 'suspensionDevice',	");
        sb.append("	dhy.test_switch	as 'testSwitch',	");
        sb.append("	dy.bottom_mounting_bolt	as 'bottomMountingBolt',	");
        sb.append("	dy.brake_plunger	as 'brakePlunger',	");
        sb.append("	dy.brake_spring_compression	as 'brakeSpringCompression',	");
        sb.append("	dy.buffer	as 'buffer',	");
        sb.append("	dy.contactor_contact	as 'contactorContact',	");
        sb.append("	dy.device_and_sill	as 'deviceAndSill',	");
        sb.append("	dy.guide	as 'guide',	");
        sb.append("	dy.insulation_performance_test	as 'insulationPerformanceTest',	");
        sb.append("	dy.limiter_safety_clamp_linkage_test	as 'limiterSafetyClampLinkageTest',	");
        sb.append("	dy.rail_bracket	as 'railBracket',	");
        sb.append("	dy.safety_clamp_holder	as 'safetyClampHolder',	");
        sb.append("	dy.top_mounting_bolt	as 'topMountingBolt',	");
        sb.append("	dy.traveling_cable	as 'travelingCable',	");
        sb.append("	dy.year_lubricating_oil	as 'yearLubricatingOil',	");
        sb.append("	'杂物电梯' as 'maintenanceType',		");
        sb.append("	dq.half_mon_id as 'halfMonId',		");
        sb.append("	dhy.quarter_id as 'quarterId',		");
        sb.append("	dy.half_year_id as 'halfYearId'		");
        sb.append(" from `debris_half_mon` dhm ");
        sb.append(" LEFT JOIN debris_quarter dq ON dhm.id = dq.half_mon_id   ");
        sb.append(" LEFT JOIN debris_half_year dhy ON dhy.quarter_id = dq.id ");
        sb.append(" LEFT JOIN debris_year dy ON dy.id = dhy.id  ");
        sb.append(" where dhm.maintenance_start_date >= " + map.get("startTime").toString() + "  and dhm.maintenance_end_date<=" + map.get("endTime").toString() + " ");

        return sb.toString();
    }
}
